#include "taskattachmentrequest.h"

namespace Wishmaster {

TaskAttachmentRequest::TaskAttachmentRequest(const PostId& postId, int attachmentIndex, const Wishmaster2::Network::Url& link, const QString& msg,
		Wishmaster2::Network::RequestManager* connector)
	: TaskRequest(rtAttachment, link, msg, connector), m_postId(postId),
	m_attachmentIndex(attachmentIndex)
{
}

void TaskAttachmentRequest::onRequestDone()
{
	QByteArray arr(request()->content()->data(), request()->content()->size());
	emit result(this, arr, QString::fromStdString(request()->contentType()));
}

PostId TaskAttachmentRequest::postId() const
{
	return m_postId;
}

int TaskAttachmentRequest::attachmentIndex() const
{
	return m_attachmentIndex;
}


} // namespace Wishmaster
